<?php
namespace Home\Controller;
use Think\Controller;

class CreditRecordController extends FrontController {
    protected function _initiali() {
        if (!session('用户')) {
            $this->success('请先登录!', U('User/login'));
        }
    }

    public function list($fromType = '', $fromId = '') {
        if (!session('用户')) {
            $this->redirect('login');
        }
        //sui
        $this->assign('title', '积分记录');
        $sui = [
            'information' => 'active',
            'return' => false,
        ];
        $this->assign('sui', $sui);
        if ($fromType != '') {
            $_SESSION['fromType'] = $fromType;
            $_SESSION['fromId'] = $fromId;
        } else {
            $_SESSION['fromType'] = '';
            $_SESSION['fromId'] = '';
        }
        $_GET['searchMap']['user_id'] = session('用户')['username'];
        parent::list();
    }
}